﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Windvoice.User.Model
{
    public class UserInfo
    {
        private int _ID; 
        private string _UserName;
        private string _Email;
        private string _User;
        private int _Sex;
        private string _Head;
        private string _Password;
        private DateTime _RegisterTime;
        private DateTime _LastvisitTime;
        private bool _IsOnline;


        public UserInfo() { }

        public UserInfo(DataRow row) 
        {
            _ID=int.Parse(row["id"].ToString()); 
            _UserName=row["username"].ToString(); 
            _Email=row["email"].ToString(); 
            _User=row["[user]"].ToString(); 
            _Sex=int.Parse(row["sex"].ToString()); 
            _Head=row["head"].ToString(); 
            _Password=row["[password]"].ToString(); 
            _RegisterTime=DateTime.Parse(row["registertime"].ToString()); 
            _LastvisitTime=DateTime.Parse(row["lastvisittime"].ToString()); 
            _IsOnline=bool.Parse(row["isonline"].ToString());
        }

        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; }
        }
        public string Email
        {
            get { return _Email; }
            set { _Email = value; }
        }
        public string User
        {
            get { return _User; }
            set { _User = value; }
        }
        public int Sex
        {
            get { return _Sex; }
            set { _Sex = value; }
        }
        public string Head
        {
            get { return _Head; }
            set { _Head = value; }
        }
        public string Password
        {
            get { return _Password; }
            set { _Password = value; }
        }
        public DateTime RegisterTime
        {
            get { return _RegisterTime; }
            set { _RegisterTime = value; }
        }
        public DateTime LastvisitTime
        {
            get { return _LastvisitTime; }
            set { _LastvisitTime = value; }
        }
        public bool IsOnline
        {
            get { return _IsOnline; }
            set { _IsOnline = value; }
        }
    }
}
